next
Round
Technologies
Experiences
Contribute
Login
next
Round
Technologies
Experiences
Contribute
Login
Question Loading...
Exception Handling
1. What is HttpException in NestJS and what two arguments does its constructor take?
Level: Expert | Frequency: High
2. What built-in HTTP exceptions does NestJS provide out of the box?
Level: Expert | Frequency: High
3. What does NestJS's built-in global exception layer do when no custom filter is registered?
Level: Expert | Frequency: High
4. How do getResponse() and getStatus() work on an HttpException and what can getResponse() return?
Level: Expert | Frequency: High
5. How do you create a domain-specific custom exception class in NestJS?
Level: Expert | Frequency: High
6. What is the cause option on HttpException and how should you use it for error tracing?
Level: Expert | Frequency: High
7. What interface must an exception filter implement and what are the two parameters of catch()?
Level: Expert | Frequency: High
8. What does the @Catch() decorator do and what happens when you omit its argument?
Level: Expert | Frequency: High
9. How do you apply an exception filter at the method, controller, and global level in NestJS?
Level: Expert | Frequency: High
10. How do you write a production-ready global all-exceptions filter that handles HttpException and unexpected errors differently?
Level: Expert | Frequency: High
11. How does exception filter resolution order work when multiple filters are registered at different levels in NestJS?
Level: Expert | Frequency: High
12. How do you extend the built-in BaseExceptionFilter to add logging while keeping default NestJS behaviour?
Level: Expert | Frequency: High
13. How do you handle exceptions differently in a filter depending on whether the request is HTTP, WebSocket, or RPC?
Level: Expert | Frequency: High
14. What are the two ways to register a global exception filter in NestJS and what is the key difference?
Level: Expert | Frequency: High
15. How do you register multiple global filters that each handle a different exception type in NestJS?
Level: Expert | Frequency: High
16. How do you integrate a third-party error tracker like Sentry inside a global exception filter in NestJS?
Level: Expert | Frequency: High
17. How do you map database and ORM exceptions to HTTP exceptions using a global filter in NestJS?
Level: Expert | Frequency: High
18. How do interceptors and exception filters divide error-handling responsibility in NestJS?
Level: Expert | Frequency: High
19. How do you add custom response headers or set cookies inside an exception filter in NestJS?
Level: Expert | Frequency: High
20. How do you write an exception filter that handles GraphQL errors differently from REST errors in NestJS?
Level: Expert | Frequency: High
21. How do you unit test an exception filter in NestJS?
Level: Expert | Frequency: High
22. How do you implement a filter that adds a request correlation ID to every error response in NestJS?
Level: Expert | Frequency: High
23. How do you prevent sensitive information from leaking through exception responses in production NestJS apps?
Level: Expert | Frequency: High
24. How do you handle async operations inside an exception filter in NestJS, for example logging to a database?
Level: Expert | Frequency: High
25. How do you re-throw an exception from within a filter to let a higher-scoped filter handle it in NestJS?
Level: Expert | Frequency: High
All Topics
Basics
Modules
Decorators
Controllers
Dependency Injection
Providers
Architecture
Request Lifecycle
Middleware
Guards
Interceptors
Pipes
Filters
Exception Handling
API Design
GraphQL
Database and ORM
Microservices
Authentication and Authorization,
Interceptors